import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-09-07
 * Time: 0:16
 */
public class Solution {
    public static Map.Entry<String,Integer>[] find(String[] arr) {
        HashMap<String,Integer> map = new HashMap<>();
        for (int i = 0; i < arr.length; i++) {
            if (!map.containsKey(arr[i])) {
                map.put(arr[i],1);
            }else {
                map.put(arr[i],map.get(arr[i]) + 1);
            }
        }
        Set<Map.Entry<String,Integer>> set = map.entrySet();
        Map.Entry<String,Integer>[] ret = set.toArray(new Map.Entry[0]);
        return ret;
    }
}
